﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;

using Microsoft.Practices.Unity;

namespace ERPStore.Web.NewsLetters.Html
{
	public class NewsLetterHelper 
	{
		public NewsLetterHelper(ViewContext viewContext, IViewDataContainer viewDataContainer)
		{
			ViewContext = viewContext;
			Url = new UrlHelper(viewContext.RequestContext);
			ViewData = new ViewDataDictionary(viewDataContainer.ViewData);
		}

		public ViewDataDictionary ViewData { get; private set; }

		public ViewContext ViewContext { get; set; }

		public UrlHelper Url { get; set; }

		public ERPStore.Settings.WebSiteSettings Settings 
		{
			get
			{
				return ERPStore.GlobalConfiguration.Configuration.Settings;
			}
		}

		[Dependency]
		public ERPStore.Services.CryptoService CryptoService { get; set; }
	}

	public class NewsLetterHelper<TModel> : NewsLetterHelper
	{
		public NewsLetterHelper(ViewContext viewContext
			, IViewDataContainer viewDataContainer)
			: base(viewContext, viewDataContainer)
		{
			this.ViewData = new ViewDataDictionary<TModel>(viewDataContainer.ViewData);
		}

		public new ViewDataDictionary<TModel> ViewData { get; private set; }
	}

}
